package user

import "kubeInstall/server/models"

type PasswordReq struct {
	OldPassword string `json:"old_password"`
	NewPassword string `json:"new_password"`
}

type User struct {
	ID string `json:"id" gorm:"primary_key;column:user_id"`

	Username        string `json:"username" gorm:"not null;column:username"`
	Password        string `json:"password" gorm:"not null"`
	Email           string `json:"email" gorm:"not null"`
	IsAdmin         bool   `json:"is_admin"`
	PasswordVersion string `json:"password_version"`
	RealName        string `json:"real_name"`
	Comment         string `json:"comment"`
	Deleted         bool   `json:"deleted"`
	RoleName        string `json:"role_name"`

	Role       int    `json:"role_id" gorm:"not null;column:role_id"`
	ResetUUID  string `json:"reset_uuid"`
	Salt       string `json:"-"`
	EnableFlag bool   `json:"enable_flag"`
	models.BaseModel
}

func (u User) TableName() string {
	return "t_sys_user"
}
